package com.ruoyi.production.service.impl.fertilizer;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.production.domain.fertilizer.FertilizerApplyTemporary;
import com.ruoyi.production.mapper.fertilizer.FertilizerApplyTemporaryMapper;
import com.ruoyi.production.service.fertilizer.IFertilizerApplyTemporaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 化肥临时申请Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-11
 */
@Service
public class FertilizerApplyTemporaryServiceImpl implements IFertilizerApplyTemporaryService
{
    @Autowired
    private FertilizerApplyTemporaryMapper fertilizerApplyTemporaryMapper;

    /**
     * 查询化肥临时申请
     *
     * @param fertilizerApplyTemporaryId 化肥临时申请ID
     * @return 化肥临时申请
     */
    @Override
    public FertilizerApplyTemporary selectFertilizerApplyTemporaryById(Long fertilizerApplyTemporaryId)
    {
        return fertilizerApplyTemporaryMapper.selectFertilizerApplyTemporaryById(fertilizerApplyTemporaryId);
    }

    /**
     * 查询化肥临时申请列表
     *
     * @param fertilizerApplyTemporary 化肥临时申请
     * @return 化肥临时申请
     */
    @Override
    public List<FertilizerApplyTemporary> selectFertilizerApplyTemporaryList(FertilizerApplyTemporary fertilizerApplyTemporary)
    {
        return fertilizerApplyTemporaryMapper.selectFertilizerApplyTemporaryList(fertilizerApplyTemporary);
    }

    /**
     * 新增化肥临时申请
     *
     * @param fertilizerApplyTemporary 化肥临时申请
     * @return 结果
     */
    @Override
    public int insertFertilizerApplyTemporary(FertilizerApplyTemporary fertilizerApplyTemporary)
    {













        fertilizerApplyTemporary.setCreateTime(DateUtils.getNowDate());



        return fertilizerApplyTemporaryMapper.insertFertilizerApplyTemporary(fertilizerApplyTemporary);
    }

    /**
     * 修改化肥临时申请
     *
     * @param fertilizerApplyTemporary 化肥临时申请
     * @return 结果
     */
    @Override
    public int updateFertilizerApplyTemporary(FertilizerApplyTemporary fertilizerApplyTemporary)
    {
        fertilizerApplyTemporary.setUpdateTime(DateUtils.getNowDate());
        return fertilizerApplyTemporaryMapper.updateFertilizerApplyTemporary(fertilizerApplyTemporary);
    }

    /**
     * 批量删除化肥临时申请
     *
     * @param fertilizerApplyTemporaryIds 需要删除的化肥临时申请ID
     * @return 结果
     */
    @Override
    public int deleteFertilizerApplyTemporaryByIds(Long[] fertilizerApplyTemporaryIds)
    {
        return fertilizerApplyTemporaryMapper.deleteFertilizerApplyTemporaryByIds(fertilizerApplyTemporaryIds);
    }

    /**
     * 删除化肥临时申请信息
     *
     * @param fertilizerApplyTemporaryId 化肥临时申请ID
     * @return 结果
     */
    @Override
    public int deleteFertilizerApplyTemporaryById(Long fertilizerApplyTemporaryId)
    {
        return fertilizerApplyTemporaryMapper.deleteFertilizerApplyTemporaryById(fertilizerApplyTemporaryId);
    }
}
